package com.example.Controller;

import com.example.Model.QutionAllModel;
import com.example.Server.TopicServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("/Topic")
public class QutionControoler {
   @Autowired
   private TopicServer _Server;

   @GetMapping("/GetTopicAll")
   public List<QutionAllModel> GetQutionAll(){
       return  _Server.Getall();
   }

   /*
   * 获取该题的具体信息
    */
   @GetMapping("/GetTopicBody")
   public  HashMap<String,Object> GetBody(@RequestParam String qid){
      return _Server.GetQutionBody(Integer.valueOf(qid));
   }


}
